/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author WinKiQue58
 */
@Embeddable
public class ServicePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_SERVICE")
    private BigInteger idService;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_BRANCHENTERPRISE")
    private BigInteger idBranchenterprise;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_ENTERPRISE")
    private BigInteger idEnterprise;

    public ServicePK() {
    }

    public ServicePK(BigInteger idService, BigInteger idBranchenterprise, BigInteger idEnterprise) {
        this.idService = idService;
        this.idBranchenterprise = idBranchenterprise;
        this.idEnterprise = idEnterprise;
    }

    public BigInteger getIdService() {
        return idService;
    }

    public void setIdService(BigInteger idService) {
        this.idService = idService;
    }

    public BigInteger getIdBranchenterprise() {
        return idBranchenterprise;
    }

    public void setIdBranchenterprise(BigInteger idBranchenterprise) {
        this.idBranchenterprise = idBranchenterprise;
    }

    public BigInteger getIdEnterprise() {
        return idEnterprise;
    }

    public void setIdEnterprise(BigInteger idEnterprise) {
        this.idEnterprise = idEnterprise;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idService != null ? idService.hashCode() : 0);
        hash += (idBranchenterprise != null ? idBranchenterprise.hashCode() : 0);
        hash += (idEnterprise != null ? idEnterprise.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServicePK)) {
            return false;
        }
        ServicePK other = (ServicePK) object;
        if ((this.idService == null && other.idService != null) || (this.idService != null && !this.idService.equals(other.idService))) {
            return false;
        }
        if ((this.idBranchenterprise == null && other.idBranchenterprise != null) || (this.idBranchenterprise != null && !this.idBranchenterprise.equals(other.idBranchenterprise))) {
            return false;
        }
        if ((this.idEnterprise == null && other.idEnterprise != null) || (this.idEnterprise != null && !this.idEnterprise.equals(other.idEnterprise))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.ServicePK[ idService=" + idService + ", idBranchenterprise=" + idBranchenterprise + ", idEnterprise=" + idEnterprise + " ]";
    }
    
}
